package com.swift.violent.mainstay.core.base.core.modal.po;

import cn.hutool.core.date.DatePattern;
import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * 接口管理者信息表
 *
 * @author xuhaifeng
 * @since 2021-01-23
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("api_user")
@Accessors(chain = true)
public class ApiUserEntity {
    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    /**
     * 接口管理者账户
     */
    @TableField("account")
    private String account;

    /**
     * 接口管理者秘钥
     */
    @TableField("secret_key")
    private String secretKey;

    /**
     * 接口管理者账户状态 1.许可 2.禁止
     */
    @TableField("account_status")
    private String accountStatus;

    /**
     * 操作时间
     */
    @TableField("optime")
    @JSONField(format = DatePattern.NORM_DATETIME_PATTERN)
    private Date optime;

    public static final String ID = "id";

    public static final String ACCOUNT = "account";

    public static final String SECRET_KEY = "secret_key";

    public static final String ACCOUNT_STATUS = "account_status";

    public static final String OPTIME = "optime";

}
